var express = require("express");
var router = express.Router();
let {testedModel} = require("../models/testedModel") //导入模型

router.get("/GetTested", async (req, res, next)=> {
    let result = await testedModel.find().populate('testId').populate('studentId')
    if (result) {
      res.send({
        code: 200,
        obj: result,
      });
    }
});
//新增已考试卷
router.post("/CreatTested", async (req, res, next)=> {
    console.log(req.body)
    let result = await testedModel.create(req.body)
    if (result) {
      res.send({
        code: 200,
        obj: result,
      });
    }
  
  });
module.exports = router;